<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title></title>
    <meta name="description" content="overview & stats" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link href="/static/css/bootstrap.min.css" rel="stylesheet" />
    <link href="/static/css/bootstrap-responsive.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="/static/css/font-awesome.min.css" />
    <link rel="stylesheet" href="/static/css/file.css" />
    <!-- 下拉框 -->
    <link rel="stylesheet" href="/static/css/chosen.css" />
    <link rel="stylesheet" href="/static/css/ace.min.css" />
    <link rel="stylesheet" href="/static/css/ace-responsive.min.css" />
    <link rel="stylesheet" href="/static/css/ace-skins.min.css" />
    <script type="text/javascript" src="/static/js/jquery-1.7.2.js"></script>
    <script type="text/javascript" src="/static/js/jquery.form.js"></script>
    <!--提示框-->
    <script type="text/javascript" src="/static/js/jquery.tips.js"></script>
    <script type="text/javascript">
        //上传图片
        function uploadPic(){
            //定义参数
            var options = {
                url : "/upload/uploadPic.shtml",
                dataType : "json",
                type :  "post",
                success : function(data){
                    //回调 二个路径
                    //url
                    //path
                    $("#allImgUrl").attr("src",data.url);
                    $("#path").val(data.path);
                    //$("").val(data.path);
                }
            };
            //jquery.form使用方式
            $("#jvForm").ajaxSubmit(options);

        }

    </script>
</head>
<body>
<div class="row">
    <div class="col-xs-12">
        <!-- PAGE CONTENT BEGINS -->
        <div class="row">
            <div class="col-xs-12">
                <div class="table-responsive">
                    <form id="jvForm" action="/user/edit.shtml" method="post" enctype="multipart/form-data">
                        <table id="sample-table-1" class="table table-striped table-bordered table-hover">
                            <input type="hidden" name="USER_ID" VALUE="${user.USER_ID}">
                            <tbody>
                            <tr>
                                <td style="text-align:right;">用户名：</td>
                                <td><input type="text" name="USERNAME" id="form-field-1"  class="col-xs-10 col-sm-5" value="${user.USERNAME}" readonly/></td>
                            </tr>
                            <tr>
                                <td style="text-align:right;">姓名：</td>
                                <td><input type="text" name="NAME" id="form-field-1"  class="col-xs-10 col-sm-5" value="${user.NAME}" readonly/></td>
                            </tr>
                            <tr>
                                <td style="text-align:right;">密码：</td>
                                <td><input type="password" name="PASSWORD" id="form-field-2"  class="col-xs-10 col-sm-5" value="" /></td>
                            </tr>
                            <tr>
                                <td style="text-align:right;">确认密码：</td>
                                <td><input type="password" name="repassword" id="form-field-3"  class="col-xs-10 col-sm-5" value="" /></td>
                            </tr>
                            <tr>
                                <td style="text-align:right;">邮箱：</td>
                                <td><input type="email" name="EMAIL" id="form-field-4"  class="col-xs-10 col-sm-5" value="${user.EMAIL}"/></td>
                            </tr>
                            <tr>
                                <td style="text-align:right;">头像：</td>
                                <td>
                                    <img src="${user.allUrl}" onerror="this.src='/static/images/default.jpg'" width="100" height="100" id="allImgUrl" />
                                    <br/><br/>
                                    <input type="hidden" name="LOGO" id="path" value="${(user.LOGO)!}"/>
                                    <a href="javascript:;" class="file">选择文件
                                        <input type="file" name="pic" id="" onchange="uploadPic()" >
                                    </a>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </form>
                </div><!-- /.table-responsive -->
            </div><!-- /span -->
        </div><!-- /row -->
    </div><!-- /.col -->
</div><!-- /.row -->
<!-- 引入 -->
<script type="text/javascript">window.jQuery || document.write("<script src='/static/js/jquery-1.9.1.min.js'>\x3C/script>");</script>
<script src="/static/js/bootstrap.min.js"></script>
<script src="/static/js/ace-elements.min.js"></script>
<script src="/static/js/ace.min.js"></script>


</body>
</html>